package org.numbfish.controller;


import jakarta.servlet.http.HttpServletRequest;
import org.numbfish.model.Result;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;

@RestController
@RequestMapping("/start")
public class StartController {
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/success")
    public Result<String> success() {
        return Result.success();
    }

    @PostMapping("/testPost")
    public Result<String> testPost(HttpServletRequest request){
        Map<String, String[]> parameterMap = request.getParameterMap();
        parameterMap.forEach((k,v)->{
            System.out.println(k+"=="+ Arrays.toString(v));
        });
        System.out.println(parameterMap);
        return Result.success();
    }
}
